<template>
	<view class="jianbao">
		<!-- 简报看板 -->
		<Title :title="title" :text="text"/>
		
		<!-- 柱状图 -->
		<!-- <Ehuikuan /> -->
		<!-- 客户数据 -->
		<card :cards="cards"/>
		<!-- 查看详情 -->
		<Detail :url='url'/>
	</view>
</template>

<script>
	import Title from './common/Title.vue';
	import Card from './common/Card.vue';
	import Detail from './common/Detail.vue';
	import Ehuikuan from './echarts/Ehuikuan.vue';
	import { ref , reactive } from "vue";
	export default {
		components: {
			Title,Card,Detail,Ehuikuan
		},
		setup(){
			const title = ref("加载中...")
			const text = ref("(权限内/2021年9月)")
			const cards = reactive([])
			const url = ref('/pages/index/Commonlist/Kehulist/Kehulist')
			// 统计图表
			// const chartsDataColumn1 = reactive({})
			const chartData={
			  categories: ["2016", "2017", "2018", "2019", "2020", "2021"],
			  series: [{
			    name: "目标值",
			    data: [35, 36, 31, 33, 13, 34]
			  }, {
			    name: "完成量",
			    data: [18, 27, 21, 24, 6, 28]
			  }]
			}
			uni.request({
				//仅为示例，并非真实接口地址。
				url: 'http://nboa.jzsoft.cn:777/pro/api/workbench/deskmode?modetype=huikuan', 
				method: 'POST',
				data:{
					selectType: "", 
					dateRang: ["2021-09-01", "2021-09-30"]
				},
				// header: {
				// 	'content-type': 'application/json'
				// },
				success: res => {
					console.log("回款+++>>>",res);
					console.log(res.data.result.statData);
					title.value = res.data.result.title  // 标题赋值
					const cardsdata = res.data.result.statData // 卡片数据
					 cardsdata.forEach(e => {  //  卡片数据赋值
					    cards.push(e);
					  });
				}
			});
			
			return{
				title,
				text,
				cards,
				chartData,
				url
			}
		}
		}
</script>

<style scoped lang="scss">

	
	
	
</style>
